//
//  KSChartMenuCell.swift
//  ZeroShare
//
//  Created by July on 2020/3/22.
//  Copyright © 2020 saeipi. All rights reserved.
//

import UIKit

class KSChartMenuCell: UICollectionViewCell {
    var textLabel:UILabel!
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        createChildViews()
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    /// 创建子控件
    private func createChildViews() {
        self.backgroundColor = UIColor.clear
        textLabel            = UILabel.init(textFont: KS_Const_Font_Normal_14, alignment: NSTextAlignment.center)
        self.addSubview(textLabel)
        textLabel.snp.makeConstraints { (make) in
            make.top.equalToSuperview()
            make.left.equalToSuperview()
            make.right.equalToSuperview()
            make.bottom.equalToSuperview()
        }
    }
    
    func updateMenu(info: Dictionary<String,String>) {
        textLabel.text = info["title"]
        if info["select"] == "true" {
            textLabel.textColor = KS_Const_Color_Menu_Text_Selectd
        }
        else{
            textLabel.textColor = KS_Const_Color_Chart_Ink
        }
        textLabel.textAlignment = .center
    }
}
